﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/List.Master"  AutoEventWireup="true" CodeBehind="Bu_Investigate_List.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Project.Bu_Investigate_List"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function openwindow(url, name) {
            var iWidth = 940; //弹出窗口的宽度;
            var iHeight = window.screen.availHeight - 30; //弹出窗口的高度;
            var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置;
            var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置;
            window.open(url, name, 'height=' + iHeight + ',innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=yes,resizeable=no,location=no,status=no');
        }
        function editReport(id, sn, name) {
            var url = "InvestigateReport.aspx?ID=" + id + "&SN=" + sn + "&Name=" + escape(name);
            openwindow(url, "现场考察报告");
        }
        function doPrint() {
            var sn = $('#<%=txtProjectSN.ClientID %>').val();
            var name = $('#<%=txtProjectName.ClientID %>').val();
            var sDate = $('#<%=dtpInvDateStart.ClientID %>').val();
            var eDate = $('#<%=dtpInvDateEnd.ClientID %>').val();
            window.open('<%=System.Configuration.ConfigurationManager.AppSettings["ReportServerURL"] %>/R015&SN=' + escape(sn) + '&Name=' + escape(name) + '&StartDate=' + sDate + '&EndDate=' + eDate + '&rc:parameters=false');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">		
    <div class="query_area">
        项目编号：<asp:TextBox ID="txtProjectSN" runat="server"  cssClass="input2" MaxLength="10" Width="50px"></asp:TextBox>&nbsp;&nbsp;
		项目名称：<asp:TextBox ID="txtProjectName" runat="server"  cssClass="input2" MaxLength="200" Width="180px"></asp:TextBox>&nbsp;&nbsp;		
		考察日期：从<asp:TextBox ID="dtpInvDateStart" runat="server" cssClass="input2" onfocus="setday(this);" Width="80px"></asp:TextBox> 到
        <asp:TextBox ID="dtpInvDateEnd" runat="server" cssClass="input2" onfocus="setday(this);" Width="80px"></asp:TextBox>&nbsp;&nbsp;
       <asp:Button runat="server" ID="btnQuery" Text="查 找" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" OnClick="btnQuery_Click" />&nbsp;&nbsp;
            <asp:Button runat="server" ID="Button1" Text="打 印" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" OnClientClick="doPrint();return false;"/>
    </div>            
    <div class="button_area">
    <div class="infoContainer" style="float:left;">
    温馨提示：本功能采用了微软Office在线编辑控件，请点击查看<a href="Remark/dsoframer_Install.htm" target="_blank" style="color:Blue;font-weight:700">安装说明</a> 
    </div>
    <div style="float:right;padding-top:10px;">
        <asp:Button runat="server" ID="btnAdd" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="新 增"/>
        <asp:Button runat="server" ID="btnDelete" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="删 除" 
            OnClientClick="javascript:return getNoSelectionAlert('chkID','请选择要删除的记录后在执行此操作！');"             
            onclick="btnDelete_Click" /></div>
    </div>
            
    <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1" id="tGrid">
		<thead>  
            <th align="center" width="30px">
                <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:checkAll(this,"chkID")' />
            </th>
            <th align="center" width="80px">考察日期</th>
            <th align="center" width="40px">项目编号</th>
            <th align="center">项目名称</th>
            <th align="center" width="80px">计划开工日期</th>
            <th align="center" width="80px">计划竣工日期</th>
            <th align="center" width="80px">实际开工日期</th>
            <th align="center" width="80px">实际竣工日期</th>
            <th align="center" width="80px">累计完成产值</th>
            <th align="center" width="50px">考察报告</th>
            <th width="50px">操作</th>
      	</thead>           
		<asp:Repeater runat="server" ID="rptList">
			<ItemTemplate>
				<tr>
					<td align="center" >
						<input type="checkbox" name="chkID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
					</td>
					<td><%# string.Format("{0:yyyy-MM-dd}",  DataBinder.Eval(Container.DataItem,"InvDate")) %></td>
					<td><%#  DataBinder.Eval(Container.DataItem,"ProjectSN") %></td>
                    <td style="text-align:left"><%#  DataBinder.Eval(Container.DataItem,"ProjectName") %></td>
					<td><%# string.Format("{0:yyyy-MM-dd}",   DataBinder.Eval(Container.DataItem,"PlanStartDate")) %></td>
					<td><%# string.Format("{0:yyyy-MM-dd}",   DataBinder.Eval(Container.DataItem,"PlanEndDate")) %></td>
					<td><%# string.Format("{0:yyyy-MM-dd}",   DataBinder.Eval(Container.DataItem,"StartDate")) %></td>
					<td><%# string.Format("{0:yyyy-MM-dd}",   DataBinder.Eval(Container.DataItem,"EndDate")) %></td>
					<td style="text-align:right"><%# string.Format("{0:N}",  DataBinder.Eval(Container.DataItem,"OutputValue")) %></td>
                    <td><a href="#" onclick="editReport('<%# DataBinder.Eval(Container.DataItem,"ID") %>', '<%#  DataBinder.Eval(Container.DataItem,"ProjectSN") %>', '<%#  DataBinder.Eval(Container.DataItem,"ProjectName") %>');">编辑</a></td>
					<td>
						<%# GetButtonScript(DataBinder.Eval(Container.DataItem,"ID")+"") %>
					</td>
				</tr>  
			</ItemTemplate>
		</asp:Repeater>
        <tr>
            <td colspan="11" style="line-height: 28px;text-align:left;">
                <frameworkwebcontrols:aspnetpager id="AspNetPager1" runat="server"
                    alwaysshow="true" firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" pageindexboxtype="DropDownList"
                    prevpagetext="上一页" showpageindex="true" showcustominfosection="Right" submitbuttontext="Go"
                    textafterpageindexbox="页" textbeforepageindexbox="转到" currentpagebuttonposition="End"
                    layouttype="Div" custominfotextalign="Right" custominfohtml="共%RecordCount%条记录。第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条"
                    direction="LeftToRight" onpagechanged="AspNetPager1_PageChanged">
                </frameworkwebcontrols:aspnetpager>            
            </td>
        </tr>
    </table>
</asp:Content>